<!DOCTYPE html>
<html lang="ru">
    <head>
        <meta charset="utf-8">
        <title>Рейтинг партнерских программ</title>
        
        <meta name="description" content="">
        <meta name="author" content="">

       
         <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" />
        
        <?php Yii::app()->clientScript->registerScriptFile('/js/brending.js'); ?>
        <?php Yii::app()->clientScript->registerScriptFile('/js/layout.js'); ?>
        <?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
         <script src="/js/jquery.cookie.js"></script>
         <script src="/js/index.js"></script>
    </head>

    <body>
        <?php if(!empty($this->brending)) : ?>
            <?php if(!empty($this->brending[0]['butImg'])) : ?>
                <a href="<?php echo $this->brending[0]['url']; ?>"><img src="/images/uploads/brending/<?php echo $this->brending[0]['butImg']; ?>" style="width: <?php echo $this->brending[0]['butW'].'px'; ?>; height: <?php echo $this->brending[0]['butH'].'px'; ?>; position: absolute; top:<?php echo $this->brending[0]['butT'].'%'; ?>; left:<?php echo $this->brending[0]['butL'].'%'; ?>"/> </a>
                <div style="position: fixed; width: 100%; height: 100%; z-index: -1;">
                    <img src="/images/uploads/brending/<?php echo $this->brending[0]['bgImg']; ?>" style="width: 100%; height: 100%;"/>
                </div>
            <?php else : ?>
                <script>var link = '<?php echo $this->brending[0]['url']; ?>';</script>
                <div style="position: fixed; width: 100%; height: 100%; z-index: -1;">
                    <a style="cursor: default" href="<?php echo $this->brending[0]['url']; ?>"><img src="/images/uploads/brending/<?php echo $this->brending[0]['bgImg']; ?>" style="width: 100%; height: 100%;"/></a>
                </div>
            <?php endif; ?>
        <?php endif; ?>
        <div class="navbar  navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                 <a class="logo" href="<?php echo Yii::app()->createUrl('site/index'); ?>"><img src="/images/logo.png" alt="" /></a>
                 <div class="top_messages">
                     <?php if(!empty($this->countNewMessages) && $this->countNewMessages['count']) : ?>
                         <a class="new_message_top" href="<?php echo Yii::app()->createUrl('user/messages/messages'); ?>">
                             
                             <?php echo $this->countNewMessages['count']; ?>
                         </a>
                     <?php endif; ?>
                     
                     <?php if(!empty($this->countNewComments) && $this->countNewComments['count']) : ?>
                         <a class="new_comments_icon" href="<?php echo Yii::app()->createUrl('user/profile/newRevComm', array('login'=>Yii::app()->user->getState('login'))); ?>">
                             
                             <?php echo $this->countNewComments['count']; ?>
                         </a>
                     <?php endif; ?>
                 </div>
                 <div class="pull-right">
                         <ul class="inline unstyled top_menu ">
                            <?php if(!Yii::app()->user->isGuest) : ?>
                                <?php $user = Yii::app()->user->getAllUserInfo(); ?>
                                <?php if(Yii::app()->user->checkAccess('admin') || $user['moderBlog'] || $user['moderNews'] || $user['moderUser'] || $user['moderPartner']) : ?> 
                                    <li> <a href="<?php echo Yii::app()->createUrl('admin/default/index'); ?>"><i class="icon-wrench icon-white"></i> админка</a> </li>
                                <?php elseif(Yii::app()->user->checkAccess('redactor')) : ?>
                                    <li> <a href="<?php echo Yii::app()->createUrl('admin/default/redactor'); ?>"><i class="icon-wrench icon-white"></i> админка</a> </li>
                                <?php endif; ?>   
                                <li> <a href="<?php echo Yii::app()->createUrl('user/profile/profile', array('login'=>Yii::app()->user->getState('login'))); ?>"><i class="icon-user icon-white"></i> <?php echo Yii::app()->user->getState('displayName'); ?></a> </li>
                                <li> <a href="<?php echo Yii::app()->createUrl('user/profile/edit', array('login'=>Yii::app()->user->getState('login'))); ?>"><i class="icon-edit icon-white"></i> (ред.)</a> </li>
                                <li> <a href="<?php echo Yii::app()->createUrl('logout'); ?>" class="navbar-link"><i class="icon-off icon-white"></i> Выйти</a> </li>
                            <?php else : ?>
                                <li> <a href="<?php echo Yii::app()->createUrl('user/default/signup'); ?>" class="navbar-link">Зарегистрироваться</a> </li>
                                <li> <a href="<?php echo Yii::app()->createUrl('login'); ?>" class="green"><i class="icon-lock"></i> Войти</a> </li>
                            <?php endif;?>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="main_menu">
                <div class="container">
                     
                        <ul class="inline unstyled">
                            <li><a href="<?php echo Yii::app()->createUrl('site/index'); ?>">Главная</a></li>
                            <?php if(!empty($this->allCats)) : ?>
                                <li>
                                     <a id="drop1" href="#" >Все категории</a>
                                     <ul  style="display:none;">
                                        <?php for($i = 0, $k=0; $i < ceil(count($this->allCats) / 4); $i++) : ?>
                                            <?php for($j = 0; $j<4; $j++, $k++) : ?>
                                                <?php if(!isset($this->allCats[$k])) continue; ?>
                                                <li><a href="<?php echo Yii::app()->createUrl('partner/default/cat', $this->allCats[$k]['parentId'] ? array('catId'=>$this->allCats[$k]['catId'], 'parentId'=>$this->allCats[$k]['parentId']) : array('catId'=>$this->allCats[$k]['catId'])); ?>"><?php echo $this->allCats[$k]['name']; ?></a></li>
                                            <?php endfor; ?>
                                        <?php endfor; ?>
                                     </ul>   
                                </li>
                            <?php endif; ?> 
                            <li><a href="<?php echo Yii::app()->createUrl('partner/default/allTopForums'); ?>">Мини-форумы</a></li>
                            <li><a href="<?php echo Yii::app()->createUrl('partner/forum/lastForumMessages'); ?>">Свежие сообщения</a></li> 
                            <li><a href="<?php echo Yii::app()->createUrl('blog/default/index'); ?>">Блог</a></li> 
                            <?php if(!empty($this->mainMenu)) : ?>
                                <?php foreach($this->mainMenu as $item) : ?>
                                    <li> <a href="/<?php echo $item['url'] ?>"><?php echo $item['text'] ?></a> </li>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </ul>
                     
                </div>
            </div>    
        </div>
        
        <div class="masthead">
           <div class="container main" id="__mainContentContainer">
           <?php if(!$this->bannersOff) : ?>
               <!-- Баннер в самом верху     -->    
               <div class="banner_head">
                   <?php if(!empty($this->rotationBanners['1000x60 px'])) : ?> 
                        <!--код баннера-->
                        <?php echo $this->rotationBanners['1000x60 px']['bannerCode']; ?>
                        <!--код заглушки-->
                        <?php echo $this->rotationBanners['1000x60 px']['emptyCode']; ?>
                   <?php else : ?>
                        <a href=""><img src="/images/banners/banner_top.png" alt="" /></a>
                   <?php endif; ?>
               </div>   

               <div class="banner_small_head">     
                   <?php if(!empty($this->rotationBanners['720х90 px'])) : ?>
                        <!-- код баннера-->
                        <?php echo $this->rotationBanners['720х90 px']['bannerCode']; ?>
                        <!--  код заглушки-->
                        <?php echo $this->rotationBanners['720х90 px']['emptyCode']; ?>
                   <?php else : ?>
                        <a href=""><img src="/images/banners/banner_top_short.png" alt="" /></a>
                   <?php endif; ?>
               </div>  
           <?php endif; ?>
           <?php echo $content; ?>
           
           <div class="footer padding40">
               <div class="footer_logo pull-left" style="position: relative">
                    <?php if(!empty($this->logoMenu)) : ?>
                        <ul class="logoMenu" role="menu" aria-labelledby="dLabel">
                            <?php foreach ($this->logoMenu as $item) : ?>
                                <li><a href="<?php echo $item['url']; ?>"><?php echo $item['text']; ?></a></li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>
                    <?php echo(date('Y')); ?> &copy; <span class="logotypeMenu" style="cursor:pointer">Партнеркин</span>    
                </div>  
                <div class="footer_social pull-right">  
                    <ul class="unstyled inline">
                        <li><a href=""><img src="/images/icons/vk.png" alt="VK" /></a></li>   
                        <li><a href=""><img src="/images/icons/fb.png" alt="Facebook" /></a></li>  
                        <li><a href=""><img src="/images/icons/gp.png" alt="Google+" /></a></li>  
                        <li><a href=""><img src="/images/icons/tw.png" alt="Twitter" /></a></li> 
                        <li>&nbsp;</li>
                        <li> <img src="/images/tmp/live.png" alt="" /></li>
                        <li> <img src="/images/tmp/ram.png" alt="" /></li>
                    </ul>
                </div>    
           </div>    
           </div>
        </div>
        
       
        
    </body>
</html>
       